using System;
using UnityEngine;
using UnityEngine.UI;

namespace CGF
{
    //该脚本自动生成或覆盖，不可编辑
    public partial class PanelWithdraw
    {   
		public CButton BtnBack;
		public Text WalletDetail;
		public CButton BtnAddWay;
		public CButton BtnCurrWay;
		public CButton BtnCurrWayEdit;
		public InputField InputAmount;
		public InputField InputPasswd;
		public CButton BtnSubmit;
		public Dropdown Dropdown;
		public RectTransform Ways;
		public Text TextServiceTip;
		public CButton BtnSetPasswd;
		public Text BottomTip;
		public I18N i18n;

        public Reference reference { get; private set; }
        public Action onProsBindCompleted;
        public bool isProsBindCompleted;
        
        public void BindProperties(Transform transform)
        {   
            reference = transform.GetComponent<Reference>();
            if(!reference)return;
            int nodeIndex = 0;
			BtnBack = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<CButton>();
			WalletDetail = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<Text>();
			BtnAddWay = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<CButton>();
			BtnCurrWay = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<CButton>();
			BtnCurrWayEdit = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<CButton>();
			InputAmount = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<InputField>();
			InputPasswd = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<InputField>();
			BtnSubmit = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<CButton>();
			Dropdown = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<Dropdown>();
			Ways = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<RectTransform>();
			TextServiceTip = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<Text>();
			BtnSetPasswd = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<CButton>();
			BottomTip = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<Text>();
			i18n = transform.GetComponent<I18N>();
            isProsBindCompleted = true;
            onProsBindCompleted?.Invoke();
        }
        
        public void SetProsBindCompletedAction(Action action)
        {
            if (isProsBindCompleted)
            {
                action?.Invoke();
            }
            else
            {
                onProsBindCompleted = action;
            }
        }

		public string I18N_can_withdraw { get { return i18n.GetTextByKey("can_withdraw"); } }
		public string I18N_can_not_withdraw { get { return i18n.GetTextByKey("can_not_withdraw"); } }
		public string I18N_please_input_amount { get { return i18n.GetTextByKey("please_input_amount"); } }
		public string I18N_please_input_passwd { get { return i18n.GetTextByKey("please_input_passwd"); } }
		public string I18N_withdraw_success { get { return i18n.GetTextByKey("withdraw_success"); } }
		public string I18N_balance_not_enough { get { return i18n.GetTextByKey("balance_not_enough"); } }
		public string I18N_please_contact_service { get { return i18n.GetTextByKey("please_contact_service"); } }
		public string I18N_invalid_amount { get { return i18n.GetTextByKey("invalid_amount"); } }
		public string I18N_service_fee { get { return i18n.GetTextByKey("service_fee"); } }
		public string I18N_set_passwd_first { get { return i18n.GetTextByKey("set_passwd_first"); } }
		public string I18N_amount_must_be_int { get { return i18n.GetTextByKey("amount_must_be_int"); } }
		public string I18N_wrong_passwd { get { return i18n.GetTextByKey("wrong_passwd"); } }
		public string I18N_bottom_tip { get { return i18n.GetTextByKey("bottom_tip"); } }
		public string I18N_xianshi_tehui { get { return i18n.GetTextByKey("xianshi_tehui"); } }
    }
}
